{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
	<div class="content">
        <!-- operation start -->
        <div class="am-g">
            <button class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus tree-submit-add" data-am-modal="{target: '#data-save-win'}"> {{:MyLang('add_title')}}</button>
        </div>
        <!-- operation end -->

        <!-- save win start -->
        <div class="am-popup am-radius" id="data-save-win">
			<div class="am-popup-inner">
				<div class="am-popup-hd">
					<h4 class="am-popup-title" data-add-title="{{:MyLang('goodscategory.base_nav_title')}}{{:MyLang('add_title')}}" data-edit-title="{{:MyLang('goodscategory.base_nav_title')}}{{:MyLang('edit_title')}}">{{:MyLang('goodscategory.base_nav_title')}}{{:MyLang('add_title')}}</h4>
					<span data-am-modal-close class="am-close">&times;</span>
				</div>
				<div class="am-popup-bd">
					<!-- form start -->
					<form class="am-form form-validation am-form-full-screen am-form-popup-fixed" action="{{:MyUrl('admin/goodscategory/save')}}" method="POST" request-type="ajax-fun" request-value="TreeFormSaveBack">
						<div class="am-cf">
                			<div class="am-u-sm-6 am-padding-horizontal-0">
                				<div class="am-form-group am-form-file">
									<label class="am-block">{{:MyLang('common_service.goodscategory.form_item_icon')}}<a href="javascript:;" class="am-icon-question-circle am-text-warning am-margin-left-sm" data-am-popover="{content: '{{:MyLang('common_service.goodscategory.form_item_icon_tips')}}', trigger: 'hover focus', theme: 'sm'}"></a></label>
									<ul class="plug-file-upload-view goods-category-icon-images-view" data-form-name="icon" data-max-number="1" data-dialog-type="images">
										<li>
											<input type="hidden" name="icon" value="" />
											<img src="{{$attachment_host}}/static/common/images/default-images.jpg" />
											<i>×</i>
										</li>
									</ul>
									<div class="plug-file-upload-submit" data-view-tag="ul.goods-category-icon-images-view">+ {{:MyLang('form_upload_images_title')}}</div>
								</div>
                            </div>
                            <div class="am-u-sm-6 am-padding-horizontal-0">
                                <div class="am-form-group am-form-file">
                                    <label class="am-block">{{:MyLang('common_service.goodscategory.form_item_icon_active')}}<a href="javascript:;" class="am-icon-question-circle am-text-warning am-margin-left-sm" data-am-popover="{content: '{{:MyLang('common_service.goodscategory.form_item_icon_active_tips')}}', trigger: 'hover focus', theme: 'sm'}"></a></label>
                                    <ul class="plug-file-upload-view goods-category-icon-active-images-view" data-form-name="icon_active" data-max-number="1" data-dialog-type="images">
                                        <li>
                                            <input type="hidden" name="icon_active" value="" />
                                            <img src="{{$attachment_host}}/static/common/images/default-images.jpg" />
                                            <i>×</i>
                                        </li>
                                    </ul>
                                    <div class="plug-file-upload-submit" data-view-tag="ul.goods-category-icon-active-images-view">+ {{:MyLang('form_upload_images_title')}}</div>
                                </div>
                			</div>
                        </div>
                        <div class="am-cf">
                			<div class="am-u-sm-6 am-padding-horizontal-0">
                				<div class="am-form-group am-form-file">
									<label class="am-block">{{:MyLang('common_service.goodscategory.form_item_realistic_images')}}<a href="javascript:;" class="am-icon-question-circle am-text-warning am-margin-left-sm" data-am-popover="{content: '{{:MyLang('common_service.goodscategory.form_item_realistic_images_tips')}}', trigger: 'hover focus', theme: 'sm'}"></a></label>
									<ul class="plug-file-upload-view goods-category-realistic_images-images-view" data-form-name="realistic_images" data-max-number="1" data-dialog-type="images">
										<li>
											<input type="hidden" name="realistic_images" value="" />
											<img src="{{$attachment_host}}/static/common/images/default-images.jpg" />
											<i>×</i>
										</li>
									</ul>
									<div class="plug-file-upload-submit" data-view-tag="ul.goods-category-realistic_images-images-view">+ {{:MyLang('form_upload_images_title')}}</div>
								</div>
                			</div>
                            <div class="am-u-sm-6 am-padding-horizontal-0">
                                <div class="am-form-group am-form-file">
                                    <label class="am-block">{{:MyLang('common_service.goodscategory.form_item_big_images')}}<a href="javascript:;" class="am-icon-question-circle am-text-warning am-margin-left-sm" data-am-popover="{content: '{{:MyLang('common_service.goodscategory.form_item_big_images_tips')}}', trigger: 'hover focus', theme: 'sm'}"></a></label>
                                    <ul class="plug-file-upload-view goods-category-big_images-images-view" data-form-name="big_images" data-max-number="1" data-dialog-type="images">
                                        <li>
                                            <input type="hidden" name="big_images" value="" />
                                            <img src="{{$attachment_host}}/static/common/images/default-images.jpg" />
                                            <i>×</i>
                                        </li>
                                    </ul>
                                    <div class="plug-file-upload-submit" data-view-tag="ul.goods-category-big_images-images-view">+ {{:MyLang('form_upload_images_title')}}</div>
                                </div>
                            </div>
                		</div>
						
                		<div class="am-cf">
                			<div class="am-u-sm-6 am-padding-horizontal-0">
                				<div class="am-form-group">
									<label>{{:MyLang('common_service.goodscategory.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
									<input type="text" placeholder="{{:MyLang('common_service.goodscategory.form_item_name_message')}}" name="name" minlength="1" maxlength="60" data-validation-message="{{:MyLang('common_service.goodscategory.form_item_name_message')}}" class="am-radius" required />
								</div>
                			</div>
                			<div class="am-u-sm-6 am-padding-horizontal-0">
                				<div class="am-form-group">
									<label>{{:MyLang('common_service.goodscategory.form_item_vice_name')}}</label>
									<input type="text" placeholder="{{:MyLang('common_service.goodscategory.form_item_vice_name_message')}}" name="vice_name" minlength="0" maxlength="60" data-validation-message="{{:MyLang('common_service.goodscategory.form_item_vice_name_message')}}" class="am-radius" />
								</div>
                			</div>
                		</div>

						<div class="am-cf">
							<div class="am-u-sm-6 am-padding-horizontal-0">
								<div class="am-form-group">
									<label>{{:MyLang('common_service.goodscategory.form_item_describe')}}</label>
									<textarea rows="1" name="describe" maxlength="200" class="am-radius" placeholder="{{:MyLang('common_service.goodscategory.form_item_describe_message')}}" data-validation-message="{{:MyLang('common_service.goodscategory.form_item_describe_message')}}"></textarea>
								</div>
							</div>
							<div class="am-u-sm-6 am-padding-horizontal-0">
								<div class="am-form-group">
									<label>{{:MyLang('form_bg_color_title')}}</label>
									<input type="hidden" name="bg_color" value="" />
									<button class="am-btn am-btn-default am-btn-xs colorpicker-submit bg-color-tag am-btn-block bk-cr-white t-r" type="button" data-input-tag="button.bg-color-tag" data-color-tag="input[name='bg_color']" data-color-style="background-color">
										<img src="{{$attachment_host}}/static/common/images/colorpicker.png" />
									</button>
								</div>
							</div>
						</div>

						<div class="am-cf">
							<div class="am-u-sm-12 am-u-md-4 am-padding-horizontal-0">
                				{{include file="lib/sort" /}}
                			</div>
                			<div class="am-u-sm-6 am-u-md-4 am-padding-horizontal-0">
                				<div class="am-form-group">
								    <label class="am-block">{{:MyLang('common_service.goodscategory.form_item_is_home_recommended')}}</label>
								    <input name="is_home_recommended" value="1" type="checkbox" data-off-text="{{:MyLang('no_title')}}" data-on-text="{{:MyLang('yes_title')}}" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (isset($data['is_home_recommended']) and $data['is_home_recommended'] eq 1) or !isset($data['is_home_recommended'])}}checked="true"{{/if}} />
								</div>
                			</div>
                			<div class="am-u-sm-6 am-u-md-4 am-padding-horizontal-0">
                				{{include file="lib/is_enable" /}}
                			</div>
                		</div>
						
						<div class="am-panel am-panel-default am-radius am-margin-horizontal-xs am-margin-top">
                            <div class="am-panel-bd">
                                {{include file="lib/seo" /}}
                            </div>
                        </div>

						<div class="am-form-popup-submit">
							<input type="hidden" name="id" />
							<input type="hidden" name="pid" value="0" />
							<button type="button" class="am-btn am-btn-warning am-radius am-btn-xs btn-loading-example am-margin-right-lg" data-am-modal-close>
                                <i class="am-icon-paint-brush"></i>
                                <span>{{:MyLang('cancel_title')}}</span>
                            </button>
                            <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('save_title')}}'}">
                                <i class="am-icon-save"></i>
                                <span>{{:MyLang('save_title')}}</span>
                            </button>
						</div>
					</form>
					<!-- form end -->
				</div>
			</div>
		</div>
		<!-- save win end -->

        <!-- list start -->
		<div id="tree" class="am-margin-top-sm" data-additional='[{"field":"bg_color", "value":"", "type":"input"}, {"field":"bg_color", "value":"", "type":"css", "tag":"button.colorpicker-submit", "style":"background-color"}, {"field":"icon", "value":"", "type":"input"}, {"field":"icon", "value":"{{$attachment_host}}/static/common/images/default-images.jpg", "type":"attr", "tag":"ul.goods-category-icon-images-view li img", "style":"src"}, {"field":"icon_active", "value":"", "type":"input"}, {"field":"icon_active", "value":"{{$attachment_host}}/static/common/images/default-images.jpg", "type":"attr", "tag":"ul.goods-category-icon-active-images-view li img", "style":"src"}, {"field":"realistic_images", "value":"", "type":"input"}, {"field":"realistic_images", "value":"{{$attachment_host}}/static/common/images/default-images.jpg", "type":"attr", "tag":"ul.goods-category-realistic_images-images-view li img", "style":"src"}, {"field":"big_images", "value":"", "type":"input"}, {"field":"big_images", "value":"{{$attachment_host}}/static/common/images/default-images.jpg", "type":"attr", "tag":"ul.goods-category-big_images-images-view li img", "style":"src"}]' data-node-url="{{:MyUrl('admin/goodscategory/getnodeson')}}" data-del-url="{{:MyUrl('admin/goodscategory/delete')}}" data-popup-tag="#data-save-win" data-rank="3">
			{{include file="public/loading" /}}
		</div>
		<!-- list end -->
	</div>
</div>
<!-- right content end -->

<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

<script type="text/javascript">
	// 初始化
	Tree(0, $('#tree').data('node-url'), 0, 1);

	// 回调处理
	function TreeFormSaveBack(e)
	{
		TreeFormSaveBackHandle(e);
	}
</script>